package cn.git.agent;

import cn.git.agent.transformer.RuntimeTransformer;

import java.lang.instrument.Instrumentation;

/**
 * @description: 运行时探针
 * @program: bank-credit-sy
 * @author: lixuchun
 * @create: 2024-03-15 03:37:46
 */
public class RunTimeAgent {

    /**
     * @description: 运行时探针切入点
     * @param arg 参数信息
     * @param instrumentation
     * @return void
     * @throws
     */
    public static void premain(String arg, Instrumentation instrumentation) {
        System.out.printf("执行探针premain方法，传入参数为[%s]%n", arg);

        // 设置传递参数信息
        RuntimeTransformer runtimeTransformer = new RuntimeTransformer();
        instrumentation.addTransformer(runtimeTransformer);
    }
}
